package com.imooc.o2o.util;

public class PathUtil {
	private static String seperator = System.getProperty("file.separator");

	/**
	 * 根据不同服务器环境获取基础路径
	 * 
	 * @return
	 */
	public static String getImgBasePath() {
		String os = System.getProperty("os.name");// 获得操作系统名称
		String basePath = "";
		if (os.toLowerCase().startsWith("win")) {
			basePath = "E:/projectdev/image/";
		} else {
			basePath = "/home/xiangze/image/";
		}
		basePath = basePath.replace("/", seperator);
		return basePath;
	}

	/**
	 * 
	 * @param shopId
	 * @return
	 */
	public static String getShopImagePath(long shopId) {
		String imagePath = "upload/images/item/shop/" + shopId + "/";
		return imagePath.replace("/", seperator);
	}
	
	public static void main(String[] args) {
		String os = System.getProperty("os.name");// 获得操作系统名称
		System.out.println(os);
	}
}
